class callbackFun {
    public callBack: Function = null;
    public thisArg = null;
    public args: any[] = [];

    public handler(callBack, thisArg, args) {
        this.callBack = callBack;
        this.thisArg = thisArg;
        this.args = args;
        return this;
    }

    public exec(execArgs = null) {
        if (execArgs) {
            this.args = execArgs;
        }
        if (this.callBack != null && this.thisArg != null) {
            return this.callBack.apply(this.thisArg, this.args);
        }
    }
}
